﻿// © 2005 IDesign Inc. All rights reserved 
//Questions? Comments? go to 
//http://www.idesign.net

using System;
using System.Web.Services;
using System.EnterpriseServices;

[WebServiceBinding("IRoleManager")]
interface IRoleManager
{
   [WebMethod(Description="Adds the specified users to the specified role.",TransactionOption=TransactionOption.RequiresNew)]
   void AddUsersToRole(string application,string[] userNames,string role);

   [WebMethod(Description="Adds the specified users to the specified roles.",TransactionOption=TransactionOption.RequiresNew)]
   void AddUsersToRoles(string application,string[] userNames,string[] roles);

   [WebMethod(Description="Adds the specified user to the specified role.",TransactionOption=TransactionOption.RequiresNew)]
   void AddUserToRole(string application,string userName,string role);

   [WebMethod(Description="Adds the specified user to the specified roles.",TransactionOption=TransactionOption.RequiresNew)]
   void AddUserToRoles(string application,string userName,string[] roles);

   [WebMethod(Description="Adds a new role to the data source.",TransactionOption=TransactionOption.RequiresNew)]
   void CreateRole(string application,string role);

   [WebMethod(Description="Removes a role from the data source. If throwOnPopulatedRole is true, throws an exception if roleName has one or more members.",TransactionOption=TransactionOption.RequiresNew)]
   bool DeleteRole(string application,string role,bool throwOnPopulatedRole);

   [WebMethod(Description="Removes all the roles from the data source. If throwOnPopulatedRole is true, throws an exception if any of the roles has one or more members.",TransactionOption = TransactionOption.RequiresNew)]
   void DeleteAllRoles(string application,bool throwOnPopulatedRole);

   [WebMethod(Description="Gets a list of all the roles for the application.",TransactionOption=TransactionOption.RequiresNew)]
   string[] GetAllRoles(string application);

   [WebMethod(Description="Gets a list of the roles that a user is in.",TransactionOption=TransactionOption.RequiresNew)]
   string[] GetRolesForUser(string application,string userName);

   [WebMethod(Description="Gets a list of users in the specified role.",TransactionOption=TransactionOption.RequiresNew)]
   string[] GetUsersInRole(string application,string role);

   [WebMethod(Description="Returns true if role management is enabled; otherwise, false.")]
   bool IsRolesEnabled(string application);

   [WebMethod(Description="Returns true if the role name already exists in the data source; otherwise, false.",TransactionOption=TransactionOption.RequiresNew)]
   bool RoleExists(string application,string role);

   [WebMethod(Description="Removes the specified user from the specified role.",TransactionOption=TransactionOption.RequiresNew)]
   void RemoveUserFromRole(string application,string userName,string roleName);

   [WebMethod(Description="Removes the specified users from the specified role.",TransactionOption=TransactionOption.RequiresNew)]
   void RemoveUsersFromRole(string application,string[] users,string role);

   [WebMethod(Description="Removes the specified user from the specified roles.",TransactionOption=TransactionOption.RequiresNew)]
   void RemoveUserFromRoles(string application,string user,string[] roles);

   [WebMethod(Description="Removes the specified user names from the specified roles.",TransactionOption=TransactionOption.RequiresNew)]
   void RemoveUsersFromRoles(string application,string[] users,string[] roles);
}
